package com.resou.reader.mine.login;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.resou.reader.R;
import com.resou.reader.api.entry.SortSubBean;
import com.resou.reader.base.v.BaseFragment;
import com.resou.reader.mine.model.FavoriteAdapter;

import java.util.List;

import butterknife.BindView;

/**
 * Created by ${Garrett} on 2018/9/3.
 * Contact me krouky@outlook.com
 */
public class FavoriteFragment extends BaseFragment {

    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;

    private FavoriteAdapter mAdapter = new FavoriteAdapter();

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_favorite;
    }

    @Override
    protected void initViews() {
        mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 4));
        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    protected void initPresenter() {
    }

    @Override
    protected void initData() {

    }

    @Override
    public Context getViewContext() {
        return getActivity();
    }

    public void setData(List<SortSubBean> subSort) {
        mAdapter.setData(subSort);
    }
}
